import request from '@/utils/request'

export function fetchAssetCategoryList(params?: any) {
  return request({
    url: '/zgyp-work/api/v1/assetcategory',
    method: 'get',
    params,
  })
}

export function fetchRootList(params?: any) {
  return request({
    url: '/zgyp-work/api/v1/assetcategory/getParent',
    method: 'get',
    params,
  })
}

export function doAdd(data: any) {
  return request({
    url: '/zgyp-work/api/v1/assetcategory',
    method: 'post',
    data,
  })
}

export function doEdit(data: any) {
  return request({
    url: `/zgyp-work/api/v1/assetcategory/${data.id}`,
    method: 'put',
    data,
  })
}

export function doDelete(data: any) {
  return request({
    url: `/zgyp-work/api/v1/assetcategory/${data.ids}`,
    method: 'delete',
    data,
  })
}

export function getDetail(data: any) {
  return request({
    url: `/zgyp-work/api/v1/assetcategory/${data.id}/form`,
    method: 'get',
  })
}
